﻿<%@ Page Theme="Default" Language="C#" MasterPageFile="~/MasterPage/MasterPage.master"
    AutoEventWireup="true" CodeFile="ChangePassword.aspx.cs" Inherits="webapp4U.UI._Default" %>

<%@ Import Namespace="webapp4U" %>
<%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>
<%@ Register Src="~/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" runat="Server">
    <uc:Title runat="server" ID="Title" />
    <table align="center" width="500px">
        <tr>
            <td align="center">
                 <asp:ChangePassword ID="ChangePassword2" runat="server">
                  <ChangePasswordTemplate>   
                    <table  cellpadding="2" border="0" align="center">
                        <tr>
                            <td align="right">
                              Mật mã cũ :
                            </td>
                            <td>
                                <asp:TextBox ID="CurrentPassword" TextMode="Password" runat="server" Width="150px"></asp:TextBox></td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequireCurrentPassword" runat="server" ControlToValidate="CurrentPassword"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="Password is required."
                                    ToolTip="Password is required." ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Mật mã mới :
                            </td>
                            <td>
                                <asp:TextBox ID="NewPassword" TextMode="Password" runat="server" Width="150px"></asp:TextBox></td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequireNewPassword" runat="server" ControlToValidate="NewPassword"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="New Password is required."
                                    ToolTip="New Password is required." ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="valPasswordLength" runat="server" ControlToValidate="NewPassword"
                                    SetFocusOnError="true" Display="Dynamic" ValidationExpression="\w{5,}" ErrorMessage="New Password must be at least 5 characters long."
                                    ToolTip="New Password must be at least 5 characters long." ValidationGroup="ChangePassword1">*</asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                               Nhập lại mật mã :
                            </td>
                            <td>
                                <asp:TextBox ID="ConfirmNewPassword" TextMode="Password" runat="server" Width="150px"></asp:TextBox></td>
                            <td>
                                <asp:RequiredFieldValidator ID="valRequireConfirmNewPassword" runat="server" ControlToValidate="ConfirmNewPassword"
                                    SetFocusOnError="true" Display="Dynamic" ErrorMessage="Confirm Password is required."
                                    ToolTip="Confirm Password is required." ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="valComparePasswords" runat="server" ControlToCompare="NewPassword"
                                    ControlToValidate="ConfirmNewPassword" SetFocusOnError="true" Display="Dynamic"
                                    ErrorMessage="The Confirm Password must match the New Password entry." ValidationGroup="ChangePassword1">*</asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                        <td colspan="3" align="right" style="padding-right:8px;">
                            <asp:Button ID="ChangePasswordPushButton" runat="server" CommandName="ChangePassword" Text="Đổi mật mã" ValidationGroup="ChangePassword1"  />
                        </td>
                        </tr>
                    </table>
                </ChangePasswordTemplate>
                  <SuccessTemplate>
                        Mật khẩu của bạn đã được thay đổi thành công
                  </SuccessTemplate>
               </asp:ChangePassword>
               
                <asp:ValidationSummary runat="server" ID="valChangePasswordSummary" ValidationGroup="ChangePassword1"
                    ShowMessageBox="true" ShowSummary="false" />
                    
            </td>
        </tr>
    </table>
</asp:Content>
